<?php

class Outils_Cookie {

	public static function setCookieLive($name, $value='', $expire=0, $path='/', $domain='', $secure=false, $httponly=false) {
		$expire = ($expire == '') ? time()+(3600*24*7) : $expire;
		//$domain = ($domain == '') ? $_SERVER['SERVER_NAME'] : $domain;
		//set a cookie as usual, but ALSO add it to $_COOKIE so the current page load has access
		$_COOKIE[$name] = $value;
		return setcookie($name,$value,$expire,$path,$domain,$secure,$httponly);
	}
}
?>